<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">

    <script src="{{ url_for('static', filename='js/jquery-1.12.0.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/jquery.form.js') }}"></script>
    <link rel="shortcut icon" href="{{ url_for('static', filename='pictures/favicon.ico') }}">


</head>
<body>
    {% if index %}
        <h1>current_app.name: {{ current_app }}</h1>
    {% else %}
        <head>nothing</head>
    {% endif %}
    <h1>Flask Globel Var</h1>
    <p>在模板里，你也可以访问 request 、 session 和 g 对象， 以及 get_flashed_messages() 函数</p>
        <p>
            <p>对于 Web 应用，与客户端发送给服务器的数据交互至关重要。<br>
                在 Flask 中 由全局的 request 对象来提供这些信息。<br>
                Flask 还能保证 线程安全
            </p>
            
            <span class='globleVar'>config:</span>当前的配置对象 (flask.config)<br>
            <span class='globleVar'>url_for():</span>flask.url_for() 函数<br>
            <span class='globleVar'>请求环境 request:</span><br>
            {% for r in request %}
                <span class='globleDir'>{{ r }}</span>
                {% if loop.index % 5 == 0 %}
                    <br>
                {% endif %}
            {% endfor %}
            <br>
            <span class='globleVar'>应用环境 g:</span><br>
            {% for gg in g %}
                <span class='globleDir'>{{ gg }}</span>
                {% if loop.index % 5 == 0 %}
                    <br>
                {% endif %}
            {% endfor %}
            <br>
            <span class='globleVar'>session:</span> <br>
            {% for s in session %}
                <span class='globleDir'>{{ s }}</span>
                {% if loop.index % 5 == 0 %}
                    <br>
                {% endif %}
            {% endfor %}
            <br>
            
            <span class='globleVar'>get_flashed_messages():</span><br>
            {% for gfm in get_flashed_messages %}
                <span class='globleDir'>{{ gfm }}</span>
                {% if loop.index % 5 == 0 %}
                    <br>
                {% endif %}
            {% endfor %}
            <br>
            <hr>
            <hr>
            <hr>
            <span class='globleVar' style='background-color: yellow;'>app:</span><br>
            {% for a in app %}
                <span class='globleDir'>{{ a }}</span>
                {% if loop.index % 5 == 0 %}
                    <br>
                {% endif %}
            {% endfor %}
            <br>
            
        </p>
    <h1>Upload & Display File</h1>




    <script type="text/javascript" src="{{ url_for('static', filename='js/style.js') }}">
    </script>
    <noscript>You need enable Javascript to view full site.</noscript>
</body>
</html>